package com.wangyadong.hobby.spingfamework.spring;

import com.wangyadong.hobby.front.model.WemailRecord;
import com.wangyadong.hobby.front.model.WuserInfo;

import java.util.Stack;

public class MyFirstServiceInDI {

    private WuserInfo wuserInfo;
    private WemailRecord wemailRecord;

    public MyFirstServiceInDI(WuserInfo wuserInfo, WemailRecord wemailRecord) {
        this.wemailRecord = wemailRecord;
        this.wuserInfo = wuserInfo;
        this.wuserInfo.setEmai("in");
        this.wemailRecord.setEmail("from");
    }

    public WuserInfo getWuserInfo() {
        return this.wuserInfo;
    }

    public void say() {
        System.out.println("MyFirstServiceInDI -- say :" + this.wemailRecord.getEmail() + "  ---> " + this.wuserInfo.getEmai());
    }

    public void init() {
        System.out.println("init the MyFirstServiceInDI  and userInfo properties has init ? getUserName  is ->" + this.wuserInfo.getUserName() + " and userInfo innner class is " +
                "" + this.getWuserInfo().getInnerClass().getName());
    }


    public void destory() {
        System.out.println(" destory the class MyFirstServiceInDI ");
    }


    public static void main(String[] args) {
        Stack stack=new Stack();
    }
}
